import { Navigate } from "react-router-dom"
//根据token控制路由跳转
 function AuthRouter({children}) {
    const token=localStorage.getItem('token')
    if (token) {
        return <>{children}</>
    }else{
        return <Navigate to={'login'} replace></Navigate>
    }
}

export {AuthRouter}